/*
 * Created on 10.10.2006 by leck
 *
 */
package de.devisnik.eidle.browser;

import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;

public class BrowserPreferences extends AbstractPreferenceInitializer {

	private static final String DEFAULT_URL = "http://code.google.com/p/eidle/";
	private static final int DEFAULT_PRESENTATION_TIME = 60;
	static final String KEY_PRESENTATION_TIME = "presentation_time";
	static final String KEY_URL = "browser_url";

	public BrowserPreferences() {
	}

	public static String getURL() {
		return getPreferences().getString(KEY_URL);
	}

	public static int getPresentationTime() {
		return getPreferences().getInt(KEY_PRESENTATION_TIME);
	}

	private static Preferences getPreferences() {
		return BrowserActivator.getDefault().getPluginPreferences();
	}

	public void initializeDefaultPreferences() {
		final Preferences preferences = getPreferences();
		preferences
				.setDefault(KEY_PRESENTATION_TIME, DEFAULT_PRESENTATION_TIME);
		preferences.setDefault(KEY_URL, DEFAULT_URL);
	}

}
